﻿//
// Created by Administrator on 2020/9/22.
//
#include <iostream>
#include <set>
#include <string>

int main() {

    using namespace std;

    set<shared_ptr<string>> set;

    shared_ptr<string> v1(new string("V1"));
    shared_ptr<string> v2(new string("v2"));

    set.insert(v1);
    set.insert(v2);
    set.insert(v2);

    for (const shared_ptr<string> &val: set) {
        cout << *val << endl;
    }

    ostream_iterator<string, char> ostreamIterator(cout, " ");
    copy(set.begin(), set.end(), ostreamIterator);

    return 0;

}